import request from '@/router/axios';
const urlPrefix = '/admin';

export function list(data) {
    return request.post(urlPrefix + '/user_merchant/list', data).then(data => {
        data && data.dataList && data.dataList.forEach(element => {
            element.payChannel = element.payChannel || 0;
        });
        return data;
    });
}

export function check(data) {
    return request.post(urlPrefix + '/user_merchant/check', data);
}

export function quitApplyCheck({
    id,
    checkStatus,
    remark
}) {
    return request.post(urlPrefix + '/user_merchant/quit_apply/check', {
        userId: id,
        checkStatus,
        remark
    });
}

// 退保证金
export function quitApplyRefund({
    id,
    refundAmount,
    refundTime,
    refundAccesssory
}) {
    return request.post(urlPrefix + '/user_merchant/quit_apply/refund', {
        userId: id,
        refundAmount,
        refundTime,
        refundAccesssory
    });
}


export function quitDetail(userId){
    return request.post(urlPrefix + '/user_merchant/quit_detail', {
        userId
    });
}
